package com.liangzhong.model.activity
{
	import flash.events.Event;
	import flash.events.EventDispatcher;

	/**
	 *首充活动 
	 * @author lake
	 * 
	 */	
	public class ActivityFourVo extends EventDispatcher
	{
		/**
		 * 是否领取
		 */		
		public var isGet :int;
		/**
		 * 已经消费数
		 */		
		public var pay	  :int;
		
		public function ActivityFourVo()
		{
		}
		/**
		 *获取领取状态 
		 * @return 
		 * 
		 */		
		public function get getStatus():int
		{
			if(isGet)//已经领取
			{
				return 2;
			}
			else
			{
				if(pay >= 2000)//大于20rmb
				{
					return 1;//可领取
				}
				else 
				{
					return 3;//未达条件
				}
			}
		}
		/**
		 *解析数据 
		 * @param obj
		 */		
		public function parse(obj :Object):void
		{
			isGet = obj.has_get;
			pay = obj.pay;
			//test
			//pay = 30000;
			this.dispatchEvent(new Event(Event.CHANGE));
		}
	}
}